
namespace SolarDevices.Configuration
{
    public class SystemConfiguration : ISystemConfiguration
    {
        #region Implementation of ISystemConfiguration

        private static string _gatewayIp = "192.168.0.1"; // defaults

        private static string _deviceIp = "192.168.0.99";

        private static string _subnetMask = "255.255.255.0";

        private static bool _lcdEnabled;
        private static bool _dhcpEnabled;
        private static string _netbiosName = "NetduinoSolar";


        public bool DHCPEnabled
        {
            get {
                bool rval;
                lock (this)
                {
                    rval = _dhcpEnabled;
                }
                return rval;
            }
            set
            {
                lock (this)
                {
                    _dhcpEnabled = value;
                }
            }
        }

        public string NetBiosName
        {
            get
            {
                string rval;
                lock (this)
                {
                    rval = _netbiosName;
                }
                return rval;
            }
            set
            {
                lock (this)
                {
                    _netbiosName = value.ToUpper();
                }
            }
        }

        public string GatewayIp
        {
            get
            {
                string rval;
                lock (this)
                {
                    rval = _gatewayIp;
                }
                return rval;
            }
            set
            {
                lock (this)
                {
                    _gatewayIp = value;
                }
            }
        }

        public string DeviceIp
        {
            get
            {
                string rval;
                lock (this)
                {
                    rval = _deviceIp;
                }
                return rval;
            }
            set
            {
                lock (this)
                {
                    _deviceIp = value;
                }
            }
        }

        public string SubnetMask
        {
            get
            {
                string rval;
                lock (this)
                {
                    rval = _subnetMask;
                }
                return rval;
            }
            set
            {
                lock (this)
                {
                    _subnetMask = value;
                }
            }
        }

        public bool LCDEnabled
        {
            get
            {
                bool rval;
                lock (this)
                {
                    rval = _lcdEnabled;
                }
                return rval;
            }
            set
            {
                lock (this)
                {
                    _lcdEnabled = value;
                }
            }
        }


        #endregion
    }
}